<?PHP
if(isset($_GET["Postion"])&&isset($_GET["Module"])){
      $LetsSorting=0;
      $sql="SELECT max(Sorting) as Sorting  FROM tagmodule WHERE TagID=".$_GET['tag']." and Postion=".$_GET["Postion"];
      $_rd=mysql_query($sql,$_db_link);
      if($_rd){
          if($daten = mysql_fetch_array($_rd, MYSQL_ASSOC)){
              $LetsSorting= $daten["Sorting"];
          }
      }
      $LetsSorting++;
      $Setting="";
      $sql= "insert into tagmodule (TagID,ModuleID,Postion,Titel,Setting,Visible,Sorting)values(".$_GET['tag'].",".$_GET["Module"].",'".$_GET["Postion"]."','".$_GET["Titel"]."','$Setting',1,$LetsSorting)";
      mysql_query($sql,$_db_link);
      GotoURL("index.php?tag={$_GET['tag']}");
}

?>
<form method="GET" id="addEditor" action="">
<div style="text-align: left">
<table>
    <tr>
        <td>
          Module:
        </td>
        <td>
          <select name="Module">
            <option value="" selected="selected">
            Please Select</option>
            <?PHP
                $sql= "select * from module";
                $_rd= mysql_query($sql,$_db_link);
                while($daten = mysql_fetch_array($_rd, MYSQL_ASSOC)){
                  echo '<option value="'.$daten["ID"].'">'.$daten["Name"].'</option>';
                }
            ?>
        </select>
        </td>
    </tr>
    <tr>
        <td>Postion:</td>
        <td><select name="Postion">
            <option value="" selected="selected">
            Please Select</option>
            <option value="2">
            Center</option>
            <option value="0">
            Top</option>
            <option value="1">
            Left</option>
            <option value="3">
            Right</option>
            <option value="4">
            Down</option>
        </select></td>
    </tr>
    <tr>
        <td>Titel:</td>
        <td><input Type="text" name="Titel"></td>
    </tr>
    <tr>
        <td></td>
        <td><input type=text value='<?PHP echo $_GET["tag"]; ?>' style="display:none" name="tag"></td>
    </tr>
    <tr>
        <td></td>
        <td><input type="submit"  name="butAdd"  value='<?php LangText("AddModule"); ?>'>
        </td>
    </tr>
</table>
</div>
</form>